package com.handpay.zztong.hp.bean;

import java.io.Serializable;

import se.krka.kahlua.vm.LuaTable;

public class BankArea implements Serializable {

	private static final long serialVersionUID = -1122576365916220535L;
	public static final int INVALID_BANKAREA_ID = -1;
	private int mBankAreaId = INVALID_BANKAREA_ID;
	private String mBankAreaName = null;
	public int getBankAreaId() {
		return mBankAreaId;
	}
	public void setBankAreaId(int mBankAreaId) {
		this.mBankAreaId = mBankAreaId;
	}
	public String getBankAreaName() {
		return mBankAreaName;
	}
	public void setBankAreaName(String mBankAreaName) {
		this.mBankAreaName = mBankAreaName;
	}
	public static BankArea generateBank(LuaTable data) {
		BankArea a = new BankArea();
		try {
			a.setBankAreaName((String) data.rawget("areaName"));
			a.setBankAreaId(Integer.parseInt((String) data.rawget("areaId")));
			return a;
		} catch (Exception e) {
			return null;
		}
	}

	@Override
	public String toString() {
		return "BankArea{" +
				"mBankAreaId=" + mBankAreaId +
				", mBankAreaName='" + mBankAreaName + '\'' +
				'}';
	}
}
